package com.xdf.wxbebarrel.model;


/**
 * @ClassName:DBConfig
 * @Description:TODO
 * @Author:chanchaw
 * @Date:2019-11-18 16:34
 * @Version:1.0
 **/
public class DBConfig {
    private String server;
    private String port;
    private String dbName;
    private String driver;

    private String dbUserName;
    private String dbUserPwd;


    /**
     * 构建数据库链接字串
     * @return
     */
    public String getUrl(){
        String ret = "jdbc:mysql://" + server + ":" + port + "/" + dbName + "?userUnicode=true&characterEncoding=utf-8&serverTimezone=UTC&useLegacyDatetimeCode=false";
        return ret;
    }


    public String getServer() {
        return server;
    }

    public void setServer(String server) {
        this.server = server;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getDbName() {
        return dbName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getDbUserName() {
        return dbUserName;
    }

    public void setDbUserName(String dbUserName) {
        this.dbUserName = dbUserName;
    }

    public String getDbUserPwd() {
        return dbUserPwd;
    }

    public void setDbUserPwd(String dbUserPwd) {
        this.dbUserPwd = dbUserPwd;
    }

    @Override
    public String toString() {
        return "DBConfig{" +
                "server='" + server + '\'' +
                ", port='" + port + '\'' +
                ", dbName='" + dbName + '\'' +
                ", driver='" + driver + '\'' +
                ", dbUserName='" + dbUserName + '\'' +
                ", dbUserPwd='" + dbUserPwd + '\'' +
                '}';
    }
}

